﻿CREATE TABLE [steve].[Category] (
    [CategoryName]        VARCHAR (50)   NOT NULL,
    [CategoryDescription] NVARCHAR (200) NULL,
    [RelevancyWeight]     DECIMAL (8, 6) NULL,
    [IsUserTag]           BIT            NOT NULL,
    [IsSiteVisible]       BIT            NOT NULL,
	[CreateDate] datetime2(7) not null,
	[CreateMembershipId] uniqueidentifier null,
	[UpdateDate] datetime2(7) not null,
	[UpdateMembershipId] uniqueidentifier null,
	[AutomatedQuery] nvarchar(200) null
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'This stores the definition of categories in the system. Note that while this table is flat, in the UI it can be presented as a hierarchy using the  “ParentCategoryName” column, but behind the scenes the queries and relevancy algorithms will use this table as though it was flat.', @level0type = N'SCHEMA', @level0name = N'steve', @level1type = N'TABLE', @level1name = N'Category';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Primary key and the SEO / URL friendly internal name of the Category.', @level0type = N'SCHEMA', @level0name = N'steve', @level1type = N'TABLE', @level1name = N'Category', @level2type = N'COLUMN', @level2name = N'CategoryName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Set to 0 for no relevancy.  Allows the business to better influence relevancy calculations by modifying the value, for example the program type (DMP / DSP) will probably be the most important category for determining related content while other categories (Male, Female, Single, etc.) may not be as important.', @level0type = N'SCHEMA', @level0name = N'steve', @level1type = N'TABLE', @level1name = N'Category', @level2type = N'COLUMN', @level2name = N'RelevancyWeight';

